package com.sie.plm.rpm.standar.util.exception;


import com.hustcad.plm.rpm.util.exception.ErrorCodeEnum;
import com.hustcad.plm.rpm.util.exception.MessageException;

import java.util.Locale;

public enum StandarErrorCodeEnum implements ErrorCodeEnum {
    REMOTE_EXCEPTION(5000, "typlm_stander_rpm_error", "", "INFO"),
    INTERFACE_NOT_ENABLED(5001, "typlm_stander_rpm_interface_not_enabled", "", "INFO");

    private int code;

    private String msg;
    private String enMsg;
    private String type;

    StandarErrorCodeEnum(int code, String msg, String enMsg, String type) {
        this.code = code;
        this.msg = msg;
        this.enMsg = enMsg;
        this.type = type;
    }


    public int getCode() {
        return this.code;
    }


    public ErrorCodeEnum setCode(int code) {
        this.code = code;
        return this;
    }


    public String getMsg() {
        return this.msg;
    }


    public ErrorCodeEnum setMsg(String msg) {
        this.msg = msg;
        return this;
    }


    public String getEnMsg() {
        return this.enMsg;
    }


    public ErrorCodeEnum setEnMsg(String enMsg) {
        this.enMsg = enMsg;
        return this;
    }


    public String getType() {
        return this.type;
    }


    public ErrorCodeEnum setType(String type) {
        this.type = type;
        return this;
    }


    public MessageException build() {
        return new MessageException(this);
    }


    public MessageException message(Object... args) {
        return (args != null && args.length != 0) ? new MessageException(this, Locale.SIMPLIFIED_CHINESE, args) : new MessageException(this, Locale.SIMPLIFIED_CHINESE);
    }
}
